package com.af.monitorModule.controller.role;

import com.af.monitorModule.generator.mapper.RoleMapper;
import com.af.monitorModule.generator.service.RoleService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @GetMapping("/getRoles")
    public JSONObject getRoles(String page,String limit){
        return roleService.getRoles(page,limit);
    }

    @PostMapping("/changeState/{id}")
    public JSONObject changeState(@PathVariable("id") String id){
        return roleService.changeState(id);
    }
}
